import request from '@/utils/request'

// 分页查询终端
export function getTerminalList(params) {
  return request({
    url: '/online/terminal-manage/devices',
    method: 'get',
    params
  })
}

// 分页查询终端
export function getModelList() {
  return request({
    url: '/online/terminal-manage/models/select',
    method: 'get'
  })
}

// 分页查询终端
export function addTerminal(data) {
  return request({
    url: '/online/terminal-manage/devices',
    method: 'post',
    data
  })
}

// 更新终端状态
export function updateTerminalStatus(devId, newStatus) {
  return request({
    url: `/online/terminal-manage/devices/${devId}/${newStatus}`,
    method: 'put'
  })
}

// 批量删除终端
export function deleteTerminal(data) {
  return request({
    url: `/online/terminal-manage/devices`,
    method: 'delete',
    data
  })
}

// 重置终端
export function resetTerminal(devId) {
  return request({
    url: `/online/terminal-manage/devices/${devId}/reset`,
    method: 'put'
  })
}